//
//  SJApplicationJumpTool.m
//  Init
//
//  Created by zhaoshijie on 06/01/2018.
//  Copyright © 2018 zhaoshijie. All rights reserved.
//

#import "SJApplicationJumpTool.h"
#import <UIKit/UIKit.h>

@implementation SJApplicationJumpTool


/**
 打开电话

 @param phoneString 手机号码
 */
+ (void)applicationJumpTelephoneWithPhoneString:(NSString *)phoneString
{
    
    NSString *urlString = [NSString stringWithFormat:@"telprompt://%@",phoneString];
    //  跳转
    [self applicationJumpWithUrlString:urlString];
    
}


/**
 跳转AppStore

 @param appId appId
 */
+ (void)applicationJumpAppStoreDownloadWithAppId:(NSString *)appId
{
    NSString *urlString = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/cn/app/jie-zou-da-shi/id%@?mt=8",appId];
    //  跳转
    [self applicationJumpWithUrlString:urlString];
}

/**
 跳转AppStore评论
 
 @param appId appId
 */
+ (void)applicationJumpAppStoreCommentWithAppId:(NSString *)appId
{
    NSString *urlString = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/cn/app/jie-zou-da-shi/id%@?mt=8&action=write-review",appId];
    //  跳转
    [self applicationJumpWithUrlString:urlString];
}

/**
 跳转App设置
 */
+ (void)applicationJumpAppSetting
{
    
    [[UIApplication sharedApplication]openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:nil];
    
}

/**
 跳转App
 
 @param urlSchemesString urlSchemesString
 */
+ (void)applicationJumpAppWithUrlSchemesString:(NSString *)urlSchemesString
{
    NSString *urlString = [urlSchemesString stringByAppendingString:@"://"];
    //  跳转
    [self applicationJumpWithUrlString:urlString];
}



/**
 跳转

 @param urlString 跳转地址
 */
+ (void)applicationJumpWithUrlString:(NSString *)urlString
{
    [[UIApplication sharedApplication]openURL:[NSURL URLWithString:urlString] options:@{} completionHandler:nil];
}


/**
 跳转浏览器地址
 
 @param urlString urlString
 */
+ (void)applicationJumpAppWithurlString:(NSString *)urlString
{
    [[UIApplication sharedApplication]openURL:[NSURL URLWithString:urlString] options:@{} completionHandler:nil];
}




@end
